﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Minestorm.Retro.Entities
{
    public class FloatingMine : Mine
    {
        public FloatingMine(GraphicsDevice graphics, MineSize mineSize, Vector2 position, float angle)
            : base(graphics, mineSize, position)
        {
            Angle = angle;
            Speed = Constants.Mine.Float_Speed;

            MineType = GameLogic.MineType.Floating;

            switch (mineSize)
            {
                case Entities.MineSize.Large:
                    Points = 100;
                    break;
                case Entities.MineSize.Medium:
                    Points = 135;
                    break;
                case Entities.MineSize.Small:
                    Points = 200;
                    break;
            }
        }

        protected override void InitializeVectors()
        {
            var verticies = new VertexPositionColor[8];
            verticies[0] = new VertexPositionColor(new Vector3(-4, 4, 0), Constants.VectorColor);
            verticies[1] = new VertexPositionColor(new Vector3(0, 2, 0), Constants.VectorColor);
            verticies[2] = new VertexPositionColor(new Vector3(4, 4, 0), Constants.VectorColor);
            verticies[3] = new VertexPositionColor(new Vector3(1, 0, 0), Constants.VectorColor);
            verticies[4] = new VertexPositionColor(new Vector3(0, -4, 0), Constants.VectorColor);
            verticies[5] = new VertexPositionColor(new Vector3(-1, 0, 0), Constants.VectorColor);

            verticies[6] = new VertexPositionColor(new Vector3(0, -1, 0), Constants.VectorColor);
            verticies[7] = new VertexPositionColor(new Vector3(0, 1, 0), Constants.VectorColor);

            SetVerticies(verticies);

            SetIndicies(new NamedShortArray("mine", true, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 0));
        }

        protected override int ShellLineCount
        {
            get { return 6; }
        }
    }
}
